<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Linkslistsservices extends Model
{
    protected $table = 'links_lists_services';
    protected $primaryKey = 'id';

    public static function insertLinksListsServices($users_id,$links_lists_users_id,$content,$type,$msgid,$created_at,$links_id,$status,$step)
    {
        return self::insert(["users_id"=>$users_id,"links_lists_users_id"=>$links_lists_users_id,"content"=>$content,"type"=>$type,"msgid"=>$msgid,"links_id"=>$links_id,"created_at"=>$created_at,"status"=>$status,"step"=>$step]);
    }

    public static function getLastLinksListsServices($users_id,$links_lists_users_id,$links_id)
    {
        return self::where("users_id",$users_id)->where("links_lists_users_id",$links_lists_users_id)->where("links_id",$links_id)->where("status",2)->orderBy("id","DESC")->first();
    }
}
